<template>
  <div class="header">
     <span>我是header组件</span>
     <button @click="sendMoney">点击我给兄弟一个小目标</button>
  </div>
</template>

<script>
export default {
  name: '',
  methods: {
      sendMoney(){
        //触发自定义事件
        //次事件源也是Vue.prototype属性身上的vm
        this.$bus.$emit('money','一个亿')
      }
  },
}
</script>

<style scoped>
  .header{
      width: 400px;
      height: 200px;
      margin: 10px auto;
      background: yellowgreen;
  }
</style>
